<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<title>Mithril.js</title>
		<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" />
		<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/themes/prism.min.css" rel="stylesheet" />
		<link href="style.css" rel="stylesheet" />
		<link rel="icon" type="image/png" sizes="32x32" href="favicon.png" />
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<meta name="description" content="[metaDescription]">
	</head>
	<body onload="window.requestAnimationFrame(function(){document.getElementById('archive-docs').selectedIndex = 0})" /* handle back navigation */>
		<header>
			<section>
				<a class="hamburger" href="javascript:;">≡</a>
				<h1><img src="logo.svg"> Mithril [archive-docs]</h1>
				<nav>
					<a href="index.html">Guide</a>
					<a href="api.html">API</a>
					<a href="https://mithril.zulipchat.com/">Chat</a>
					<a href="https://github.com/MithrilJS/mithril.js">GitHub</a>
				</nav>
			</section>
		</header>
		<main>
			<section>
				[body]
				<hr />
				<small>License: MIT. &copy; Leo Horie.</small>
			</section>
		</main>
		<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/prism.min.js"></script>
		<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/components/prism-jsx.min.js"></script>
		<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/components/prism-diff.min.js"></script>
		<script src="https://unpkg.com/mithril@[version]/mithril.js" async></script>
		<script src="https://flems.io/flems.html" id="flems" defer></script>
		<script>
		document.querySelector(".hamburger").onclick = function() {
			document.body.className = document.body.className === "navigating" ? "" : "navigating"
			document.querySelector("h1 + ul").onclick = function() {
				document.body.className = ''
			}
		}
		document.getElementById("flems").onload = function() {
			var systemFonts = [
				"body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; }",
				"body { height: 100%; overflow:hidden; display:flex; justify-content: center; align-items:center; }"
			].join("")
			;[].forEach.call(document.querySelectorAll("pre code.language-js"), function(el) {
				el = el.parentNode

				var div = document.createElement("div")
				window.Flems(div, {
					middle        : 60,
					editable      : true,
					toolbar       : false,
					shareButton   : true,
					console       : false,
					autoHeight    : true,
					files: [{
						name: ".js",
						content: el.textContent
					}, {
						name: ".css",
						content: systemFonts
					}],
					links: [{
						name: "mithril",
						type: "script",
						url: "https://unpkg.com/mithril@[version]/mithril.js"
					}]
				}, "https://flems.io/flems.html")

				el.parentNode.insertBefore(div, el)
				el.parentNode.removeChild(el)
			})
		}
		</script>
	</body>
</html>
